package com.zhanjixun.weixin.domain;

import com.alibaba.fastjson.JSON;
import lombok.Data;
import org.json.XML;

/**
 * 撤回消息 实体
 *
 * @author :zhanjixun
 * @date : 2018/11/20 13:35
 */
@Data
public class RevokeMsg {

    private String session;

    private String oldMsgId;

    private String msgId;

    private String replaceMsg;

    public static RevokeMsg valueOf(String xml) {
        return JSON.parseObject(XML.toJSONObject(xml)
                .getJSONObject("sysmsg")
                .getJSONObject("revokemsg").toString(), RevokeMsg.class);
    }
}
